GenerativeComponents Help

The While Statement

Provides a way to perform another statement repetitively.

General Form

while (expression)
	statement

The expression must result in a bool value. If that value is true, then:

  1. The nested statement is performed.

  2. Control transfers back to the while expression, which is calculated again. If its result is true again, these steps are repeated.

The first time that the expression results in false, the entire while statement is exited, and the program proceeds with the next statement afterwards. Note that, if the expression is initially false, the nested statement will never be performed at all.